package net.xiduth.game.player.content.agility;

import net.xiduth.game.player.Player;
import net.xiduth.game.player.Skills;

public class AgilityPoints {
	
	
public static int EXCH = 6;
public static int TITLE = 43;

	public static void sendExchange (Player player)  {
		player.getPackets().sendIComponentText(EXCH, TITLE, "Agility Points exchange, current points: "+player.agilityPoints+".");
		player.getInterfaceManager().sendInterface(EXCH);
	}
	

	  public static void handleButtons(Player player, int componentId) {
	        if (componentId == 28) {
	        	if (player.agilityPoints >= 1000) {
	        		player.agilityPoints -= 1000;
	        		player.sm("Payment was successful. Current points: "+player.agilityPoints+".");
	        		player.getSkills().addXp(Skills.AGILITY, 500.50);
	        	} else {
	        		player.sm("You don't have enough points for this payment.");
	        	}
	        }
	        
	        if (componentId == 27) {
	        	if (player.agilityPoints >= 100) {
	        		player.agilityPoints -= 100;
	        		player.sm("Payment was successful. Current points: "+player.agilityPoints+".");
		        		player.getSkills().addXp(Skills.AGILITY, 75.50);
	        	} else {
	        		player.sm("You don't have enough points for this payment.");
	        	}
	        }
	            if (componentId == 26) {
		        	if (player.agilityPoints >= 25) {
		        		player.agilityPoints -= 25;
		        		player.sm("Payment was successful. Current points: "+player.agilityPoints+".");
			        	  		player.getSkills().addXp(Skills.AGILITY, 30.50);
		        	} else {
		        		player.sm("You don't have enough points for this payment.");
		        	}
	            }
      if (componentId == 25) {
      	if (player.agilityPoints >= 10) {
      		player.agilityPoints -= 10;
      		player.sm("Payment was successful. Current points: "+player.agilityPoints+".");
	        	  		player.getSkills().addXp(Skills.AGILITY, 15.50);
      	} else {
      		player.sm("You don't have enough points for this payment.");
      	}
      }
      if (componentId == 24) {
        	if (player.agilityPoints >= 1) {
        		player.agilityPoints -= 1;
        		player.sm("Payment was successful. Current points: "+player.agilityPoints+".");
  	        	  		player.getSkills().addXp(Skills.AGILITY, 7.50);
        	} else {
        		player.sm("You don't have enough points for this payment.");
        	}
        }
      if (componentId == 13) {
        	if (player.agilityPoints >= 800) {
        		player.agilityPoints -= 800;
        		player.sm("Payment was successful. Current points: "+player.agilityPoints+".");
  	        	  	player.getInventory().addItem(2997, 1);
  	        	  	player.getInventory().refresh();
        	} else {
        		player.sm("You don't have enough points for this payment.");
        	}
        }
}
}
		
